home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / teco.zip / TECO.DOC < prev    next >
Text File  |  1986-07-15  |  4KB  |  118 lines

  1.             Introduction to TECO Context Editor
  2.             -----------------------------------
  3.  
  4.     The TECO (TExt COntext) editor is a non-visual, character oriented
  5. editor which was developed at the Massachussets Institute of Technology in
  6. the late 1960s as part of a project in artificial intelligence.  When fully
  7. implemented, TECO supports conditionals, branching, and forms its own unique
  8. programming language, in fact EMACs was originally written in TECO !!!  My
  9. version is considerably simplified from full-blown TECO, but it still is
  10. very powerful, allowing the user to edit BINARY (ie .EXE) as well as simple
  11. ASCII files, changing the value of arbitrary bytes anywhere in the file.
  12.  
  13.     To start editing in my version of TECO, you must give a file
  14. specification on the command line.  Do this by typing either
  15.  
  16.     TECO myfile.ext
  17.  
  18. if you want to edit "myfile.ext", or you can type
  19.  
  20.     TECO outfile.ext=infile.ext
  21.  
  22. where "outfile.ext" is the output file, and "infile.ext" is the source
  23. file.  To create a file from scratch, enter the command
  24.  
  25.     TECO newfile.ext=NUL
  26.  
  27. where "newfile.ext" is the new file, and "NUL" is the null device.
  28.     Congratulations!!  You are now in TECO mode, and can start using
  29. the TECO command set.  TECO commands are character sequences of the form
  30.  
  31.     number letter string ESC
  32.  
  33. where "number" is signed number which defaults to 1 if not specified,
  34. "letter" is a valid TECO command, "string" is the object for the command,
  35. and "ESC" is the escape key (which echoes as $ on the console display).
  36. Commands sequences are not executed immediately, but are stacked in a buffer
  37. for later execution.  All the TECO commands stored in the buffer are then
  38. executed at once when the user types two ESC characters.  The TECO commands
  39. implemented are:
  40.  
  41.     num A            - Appends "number" pages of text to work area
  42.                   from the input file, where a "page" is
  43.                   defined as an arbitrary number of bytes,
  44.                   ending in "Form Feed"
  45.  
  46.     num C            - Advance "number" characters in the page.
  47.  
  48.     num D            - Delete  "number" characters.
  49.  
  50.     EF            - Exit TECO without writing this page to
  51.                   the output file
  52.  
  53.     EX            - Exit TECO, writing this page out and
  54.                   then copying the remainder of the input
  55.                   file to the output file.  Normal TECO exit
  56.  
  57.     num FS old ESC new ESC    - Replace string "old" with string "new"
  58.                   a total of "num" times.  Replace fails if
  59.                   string "old" not on current page.
  60.  
  61.     num FN old ESC new ESC    - Replace string "old" with string "new"
  62.                   a total of "num" times, Paging in text
  63.                   as necessary...
  64.  
  65.     HK            - Delete everything in the current page.
  66.  
  67.     HT            - Type everything in the current page.
  68.  
  69.     num I            - Insert a single ascii character whose value
  70.                   is "number" into the page.
  71.  
  72.     I text ESC        - Insert "text" from buffer.
  73.  
  74.     num J            - Jump to position "number" in page.  If
  75.                   "num" is omitted, go to start of page
  76.  
  77.     num K            - Kill "number" lines from the page.
  78.  
  79.     num L            - Advance "num" lines in page.
  80.  
  81.     num N string ESC    - Search for "string" a total of "num" times
  82.                   Go to end of file if needed to find "string"
  83.  
  84.     num P            - Write page to the output file, and read in
  85.                   a new page from the input file.  Do this
  86.                   a total of "num" times.
  87.     num R            - Go backward "num" characters in the page
  88.  
  89.     num S string ESC    - Search for "string" a total of "num" times,
  90.                   with error if not found on current page.
  91.  
  92.     num T            - Type out next "num" lines in page
  93.  
  94.     num V            - Type out "num" lines preceding and "num"
  95.                   lines following current location in page.
  96.  
  97.     num < string ESC > ESC    - Iterate the "string" TECO command(s) within
  98.                   angle brackets a total of "num" times.
  99.                   If "num" not specified, iterate forever.
  100.                   This is a *VERY POWERFUL* command.
  101.  
  102.     ^C            - Exit TECO and delete output file.  The
  103.                   input file will be left untouched...
  104.  
  105. There are also some characters which assume numeric values.  These are:
  106.  
  107.     B            - This is a synonym for 0 (zero)
  108.  
  109.     Z            - This is the number of characters in
  110.                   the current page
  111.  
  112.     .            - This is where you are in the page.
  113.  
  114. (this version of TECO does not support arithmetic with numeric values.)
  115.  
  116. To cancel TECO typeout, hit CTRL-O, and all output will be suppressed
  117. until the next TECO command string is requested from the console.
  118.